-
Couldn't load subscription status.
- Fork 7
feat(routing/http): return 200 for empty results per IPIP-513 #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
changes: - server returns 200 instead of 404 for empty results - providers: empty JSON/NDJSON array - peers: empty JSON/NDJSON array - ipns: text/plain "Record not found" - client handles both 200 and 404 responses for backward compatibility - client handles null/undefined Providers/Peers fields test coverage: - added tests for 404 backward compatibility (old servers) - added tests for null/undefined field handling - added tests for IPNS content-type validation - test fixtures use special CIDs to trigger edge cases
53b7481 to
1459f1d
Compare
| const peerCid = CID.parse(cidStr) | ||
| peerId = peerIdFromCID(peerCid) | ||
| } catch (err) { | ||
| } catch (err: any) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think : any has been added here to mask a TypeScript error. The error is valid - fastify's pino logger doesn't log additional arguments without formatters and the types have been updated to reflect this, causing the error where there wasn't one before.
The correct solution is either to add a formatter:
fastify.log.error('could not parse CID from params - %s', err)
or pass the error as a merging object:
fastify.log.error({ err }, 'could not parse CID from params')
The latter is probably better as depending on the Error implementation we can lose information during stringification.
Docs link: https://github.com/pinojs/pino/blob/main/docs/api.md
## [@helia/delegated-routing-v1-http-api-client-v5.1.0](https://github.com/ipfs/helia-delegated-routing-v1-http-api/compare/@helia/delegated-routing-v1-http-api-client-5.0.1...@helia/delegated-routing-v1-http-api-client-5.1.0) (2025-10-27) ### Features * **routing/http:** return 200 for empty results per IPIP-513 ([#174](#174)) ([a0aebb7](a0aebb7))
|
🎉 This PR is included in version @helia/delegated-routing-v1-http-api-client-v5.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [@helia/delegated-routing-v1-http-api-server-v5.1.0](https://github.com/ipfs/helia-delegated-routing-v1-http-api/compare/@helia/delegated-routing-v1-http-api-server-5.0.0...@helia/delegated-routing-v1-http-api-server-5.1.0) (2025-10-27) ### Features * **routing/http:** return 200 for empty results per IPIP-513 ([#174](#174)) ([a0aebb7](a0aebb7))
|
🎉 This PR is included in version @helia/delegated-routing-v1-http-api-server-v5.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
Implements IPIP-513 spec changes for delegated routing v1 endpoints to return 200 with empty results instead of 404 + some extra fixes to ensure client interop with broad type of servers.
changes
test coverage
Notes & open questions
Change checklist